package name.panitz.ludens.animationGame;
import name.panitz.ludens.util.ShowInFrame;
import javax.swing.JPanel;

public class PaintableImage extends JPanel implements Paintable{

  /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
MyImage mi;

  public PaintableImage(MyImage mi){this.mi=mi;}
  public PaintableImage(String name){this.mi=new MyImage(name);}

  public void paintTo(java.awt.Graphics g){
    g.drawImage(mi.get(),0,0,this);
  }

  public static void main(String [] args){
    PaintableImage pi = new PaintableImage("test.png");

    System.out.println(pi.mi.get().getHeight(pi));

    ShowInFrame.show(new PaintablePanel(pi)); 
  }
}

